package com.mes_for_xxxxxx.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.mes_for_xxxxxx.entity.Equipment;
import com.mes_for_xxxxxx.mapper.EquipmentMapper;
import com.mes_for_xxxxxx.service.IEquipmentService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * <p>
 * 设备信息表 服务实现类
 * </p>
 *
 * @author 179005
 * @since 2024-09-10
 */
@Service
public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment> implements IEquipmentService {

    @Override
    @Transactional
    public void updateStatus(Integer id, Integer status) {
        Equipment equipment = baseMapper.selectOne(new QueryWrapper<Equipment>().eq("id", id));
        equipment.setStatus(status);
        baseMapper.updateById(equipment);
    }
}
